/* Class39_Sub5_Sub8 - Decompiled by JODE
 * Visit http://jode.sourceforge.net/
 */
import java.awt.Graphics;

public class Class39_Sub5_Sub8 extends Class39_Sub5
{
    public static int anInt1790 = 0;
    public int anInt1791;
    public static JString[] aClass3Array1792 = new JString[1000];
    public int anInt1793;
    public int anInt1794;
    public static Class9 aClass9_1795;
    public static Class7 aClass7_1796 = new Class7(10);
    public static JString aClass3_1797
	= Class39_Sub5_Sub9.createJString(106, "@whi@ )4 ");
    public static int anInt1798 = 0;
    
    public static void method590(boolean bool) {
	try {
	    Graphics graphics = Class41.aCanvas778.getGraphics();
	    PacketStream.aClass57_2155.method1010(-39, graphics, 0, 4);
	    Class55.aClass57_1248.method1010(-107, graphics, 0, 357);
	    Class57_Sub2.aClass57_1576.method1010(-97, graphics, 722, 4);
	    Class11.aClass57_182.method1010(-119, graphics, 743, 205);
	    Class43.aClass57_812.method1010(-65, graphics, 0, 0);
	    Class63.aClass57_1122.method1010(-123, graphics, 516, 4);
	    CollisionMap.aClass57_516.method1010(-103, graphics, 516, 205);
	    RSInterface.aClass57_2114.method1010(-112, graphics, 496,
							357);
	    Queue.aClass57_981.method1010(-66, graphics, 0, 338);
	} catch (Exception exception) {
	    Class41.aCanvas778.repaint();
	}
    }
    
    public static void method591(byte i) {
	Class39_Sub11 class39_sub11
	    = (Class39_Sub11) Class15.aClass49_278.method969(false);
	if (i != 92)
	    method591((byte) -28);
	for (/**/; class39_sub11 != null;
	     class39_sub11 = ((Class39_Sub11)
			      Class15.aClass49_278.method963((byte) -87))) {
	    if (class39_sub11.anInt1456 > 0)
		class39_sub11.anInt1456--;
	    if (class39_sub11.anInt1456 == 0) {
		if (class39_sub11.anInt1471 < 0
		    || Class39_Sub9.method862(i - 92, class39_sub11.anInt1451,
					      class39_sub11.anInt1471)) {
		    Class55.method1000(class39_sub11.anInt1469,
				       class39_sub11.anInt1458,
				       class39_sub11.anInt1449,
				       class39_sub11.anInt1474,
				       class39_sub11.anInt1471,
				       class39_sub11.anInt1451,
				       class39_sub11.anInt1466, false);
		    class39_sub11.unlink();
		}
	    } else {
		if (class39_sub11.anInt1476 > 0)
		    class39_sub11.anInt1476--;
		if (class39_sub11.anInt1476 == 0
		    && class39_sub11.anInt1466 >= 1
		    && class39_sub11.anInt1474 >= 1
		    && class39_sub11.anInt1466 <= 102
		    && class39_sub11.anInt1474 <= 102
		    && (class39_sub11.anInt1459 < 0
			|| Class39_Sub9.method862(0, class39_sub11.anInt1457,
						  class39_sub11.anInt1459))) {
		    Class55.method1000(class39_sub11.anInt1469,
				       class39_sub11.anInt1458,
				       class39_sub11.anInt1472,
				       class39_sub11.anInt1474,
				       class39_sub11.anInt1459,
				       class39_sub11.anInt1457,
				       class39_sub11.anInt1466, false);
		    class39_sub11.anInt1476 = -1;
		    if (class39_sub11.anInt1459 != class39_sub11.anInt1471
			|| class39_sub11.anInt1471 != -1) {
			if (class39_sub11.anInt1459 == class39_sub11.anInt1471
			    && (class39_sub11.anInt1472
				== class39_sub11.anInt1449)
			    && (class39_sub11.anInt1451
				== class39_sub11.anInt1457))
			    class39_sub11.unlink();
		    } else
			class39_sub11.unlink();
		}
	    }
	}
    }
    
    public void method592(Stream class39_sub6, byte i) {
	for (;;) {
	    int i_0_ = class39_sub6.readByte((byte) -8);
	    if (i_0_ == 0)
		break;
	    method596(i_0_, -27451, class39_sub6);
	}
    }
    
    public static void method593(int i, int i_1_, boolean bool, byte[] is,
				 int i_2_) {
	if (Class55.aClass62_1251 != null) {
	    if (Class39_Sub5_Sub4_Sub3.anInt2239 < 0) {
		if (Class39_Sub9.anInt1415 != 0) {
		    Class35.aBoolean628 = bool;
		    Class39_Sub5_Sub6.aByteArray1768 = is;
		    Class39_Sub5_Sub18.anInt2120 = i;
		} else
		    Class39_Sub9.method857(i, bool, is, false);
	    } else {
		Queue.anInt987 = i_2_;
		if (Class39_Sub5_Sub4_Sub3.anInt2239 != 0) {
		    int i_3_ = (GameCharacter.method512
				(929, Class39_Sub5_Sub4_Sub3.anInt2239));
		    i_3_ -= Class65.anInt1141;
		    Class39_Sub9.anInt1415 = (i_3_ + 3600) / i_2_;
		    if (Class39_Sub9.anInt1415 < 1)
			Class39_Sub9.anInt1415 = 1;
		} else
		    Class39_Sub9.anInt1415 = 1;
		Class39_Sub5_Sub6.aByteArray1768 = is;
		Class39_Sub5_Sub18.anInt2120 = i;
		Class35.aBoolean628 = bool;
	    }
	}
    }
    
    public static void method594(int i, int i_4_) {
	if (RSSocket.method219(0, i_4_)) {
	    RSInterface[] class39_sub5_sub17s
		= Class62_Sub1.interfaceCache[i_4_];
	    for (int i_5_ = 0; i_5_ < class39_sub5_sub17s.length; i_5_++) {
		RSInterface class39_sub5_sub17
		    = class39_sub5_sub17s[i_5_];
		if (class39_sub5_sub17 != null) {
		    class39_sub5_sub17.anInt2079 = 0;
		    class39_sub5_sub17.anInt1999 = 0;
		}
	    }
	}
    }
    
    public static void method595(int i) {
	synchronized (Class39_Sub5_Sub4_Sub4_Sub1.aClass35_2499) {
	    Stream.anInt1368 = Renderable.anInt1731;
	    if (Class18.anInt341 < 0) {
		for (int i_6_ = 0; i_6_ < 112; i_6_++)
		    Class13.aBooleanArray200[i_6_] = false;
		Class18.anInt341 = Class46.anInt879;
	    } else {
		while (Class18.anInt341 != Class46.anInt879) {
		    int i_7_
			= Class39_Sub5_Sub11.anIntArray1847[Class46.anInt879];
		    Class46.anInt879 = Class46.anInt879 + 1 & 0x7f;
		    if (i_7_ >= 0)
			Class13.aBooleanArray200[i_7_] = true;
		    else
			Class13.aBooleanArray200[i_7_ ^ 0xffffffff] = false;
		}
	    }
	    Renderable.anInt1731 = GameCharacter.anInt2299;
	}
    }
    
    public void method596(int i, int i_8_, Stream class39_sub6) {
	if (i_8_ != -27451)
	    anInt1791 = -53;
	if (i == 1) {
	    anInt1791 = class39_sub6.readShort(106);
	    anInt1793 = class39_sub6.readByte((byte) -8);
	    anInt1794 = class39_sub6.readByte((byte) -8);
	}
    }
    
    public static void method597(int i) {
	OnDemandFetcher.aClass57_1196.method1006(10);
    }
    
    public static void method598(byte i) {
	aClass3_1797 = null;
	aClass3Array1792 = null;
	aClass7_1796 = null;
	aClass9_1795 = null;
    }
}
